﻿@model RiderShop.Mobile.Modle.CustomerModel
@{
    Layout = "../Shared/_MobileLayout.cshtml";
}
@section header
{
    <link rel="stylesheet" href="~/Themes/RongJi/Style/base/css/sign.css">
}
@section title
{
    用户注册
}
@section pagetitle
{
    用户注册
}
<div class="top"><img src="~/Themes/RongJi/Style/base/imgs/signup_top.jpg" alt=""></div>
<form action="~/Customer/Register" method="POST" id="submitForm">
    <div class="body">

        <input type="hidden" id="returnUrl" name="returnUrl" value="@Model.ReturnUrl" />
        @Html.Hidden("ThirdUserId", @Model.CurrentUser.ThirdUserId)
        @*<input type="text" id="UserName" class="form-control" name="UserName" placeholder="请输入用户名" value="@Model.CurrentUser.UserName" 
            onchange="surnam_keyup(this);" onkeyup="surnam_keyup(this);" onkeypress="return surnam_keypress();">*@
        <input type="text" id="Email" class="form-control" name="Email" placeholder="请输入有效的邮箱地址" value="@Model.CurrentUser.Email">
        <input type="text" id="CellPhone" class="form-control" name="CellPhone" placeholder="请输入手机号" value="@Model.CurrentUser.CellPhone">
        <input type="password" id="PassWord" class="form-control" name="PassWord" placeholder="请输入密码" autocomplete="off">
      
        @if (Model.Result != null && !Model.Result.Status)
        {
            <span class="err_msg">@Model.Result.ErrorMessage</span>
        }
        else
        {
            <span class="err_msg" id="msgError"></span>
        }
    </div>
    <div class="bottom">
        <img src="~/Themes/RongJi/Style/base/imgs/ss.jpg" alt="">
        <div class="btn-group btn-group-justified btn-wrapper" role="group" aria-label="...">
            <div class="btn-group" role="group">
                <input class="btn btn-green" type="button" data-role="button" id="btnSubmit" value="提交">
            </div>
            <div class="btn-group" role="group">
                <button type="button" class="btn" onclick="window.history.go(-1);">取消</button>
            </div>
        </div>
    </div>
</form>
@section footer
{
@*@if (Model.Result != null && !Model.Result.Status)
    {
        <script type="text/javascript">
            $('div').on('pageshow', function (event, ui) {
                KevinShop.MessageBox.Alert("@Model.Result.ErrorMessage");
            });
        </script>
    }*@

<script type="text/javascript">
    $("#btnSubmit").click(function () {
        //if ($("#UserName").val() == "") {
        //    KevinShop.MessageBox.Alert("请输入用户名!");
        //    return false;
        //}
        //else 
        if ($("#Email").val() == "" || !checkMail($("#Email").val())) {
            KevinShop.MessageBox.Alert("请输入有效的邮箱地址!");
            return false;
        } else if ($("#CellPhone").val() == "" || !checkNum($("#CellPhone").val())) {
            KevinShop.MessageBox.Alert("请输入手机号!");
            return false;
        }
        else if ($("#PassWord").val() == "") {
            KevinShop.MessageBox.Alert("请输入密码!");
            return false;
        }  
        document.forms["submitForm"].submit();
        
    });


    //让toolbar选中
    var $homeImg = $("#homeImg");
    var $categoryImg = $("#categoryImg");
    var $myaccountImg = $("#myaccountImg");
    var $searchImg = $("#searchImg");

    $homeImg.attr("src", "/Themes/RongJi/Style/base/imgs/f10.png");
    $categoryImg.attr("src", "/Themes/RongJi/Style/base/imgs/f2.png");
    $myaccountImg.attr("src", "/Themes/RongJi/Style/base/imgs/f3_c.png");
    $searchImg.attr("src", "/Themes/RongJi/Style/base/imgs/f4.png");
</script>
}
